package com.leadnews.article.fegin;

import com.leadnews.apis.article.IArticleClient;
import com.leadnews.article.service.ApArticleService;
import com.leadnews.model.article.dtos.ArticleDto;
import com.leadnews.model.article.pojos.ApArticleConfig;
import com.leadnews.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ArticleClient implements IArticleClient  {

    @Autowired
    private ApArticleService apArticleService;

    @PostMapping("/api/vi/article/save")
    public ResponseResult saveArticle(ArticleDto dto) {
        return apArticleService.saveArticle(dto);
    }

    @PostMapping("/api/vi/article/upOrDown")
    public ResponseResult downOrUp(ApArticleConfig dto) {
        return apArticleService.downOrUp(dto);
    }
}
